import Vue from "vue";
// import App from "@/template/App.vue";
// import router from "./router";
// import store from "@/store";
import mixin from "@/mixin";
import directives from "@/directives";
import "@/directives";
import api from "@/request/api";
import apiList from "@/request/apilLst";
import filters from "@/filters";
import config from "@/configs/config.js";
import { Toast, Dialog } from "vant";
if (process.env.NODE_ENV === "production") {
  window.console.log = () => { };
  window.console.dir = () => { };
  window.console.warn = () => { };
}
if (config.env !== "prd") {
  const vConsole = require("vconsole");
  new vConsole();
}
Vue.use(Toast);
Vue.use(Dialog);
Vue.prototype.$api = api;
Vue.prototype.$apiList = apiList;
Vue.config.productionTip = false;
Vue.prototype.$baseConfigs = config;
Vue.mixin(mixin);
Vue.use(directives);
mixin.methods.$getToken();
Object.keys(filters).forEach((key) => Vue.filter(key, filters[key]));

export function render(params, extend = {}) {
  Object.keys(extend).forEach((key) => {
    Vue.prototype[`$${key}`] = extend[key];
  });
  return new Vue({ ...params });
}
